package com.zhijiang.util;

/**
 * @author 75936
 * @version 1.0
 * @project zhijiang_hospital_data
 * @description
 * @date 2023-02-23 15:07:40
 */
public class NumberUtils {

    public static Integer drawSurplus(Long nums, Integer pageNum) {
        Long pageNums = pageNum.longValue();
        Long num = (nums % pageNums);
        if (num != 0) {
            int surplus = num.intValue();
            return surplus;
        } else {
            return pageNum;
        }
    }

    public static Integer totalPages(Long nums, Integer pageNum) {
        Long pageNums = pageNum.longValue();
        Long num = (nums % pageNums);
        if (num != 0) {
            Long number = (nums / pageNums);
            int pages = number.intValue() + 1;
            return pages;
        } else {
            Long number = (nums / pageNums);
            int pages = number.intValue();
            return pages;
        }


    }

}
